/*
 * @Author: your name
 * @Date: 2020-07-25 22:48:15
 * @LastEditTime: 2020-07-25 23:40:06
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \ts\react-redux-app\src\store\demo_reducer.js
 */

 import {CHANGEiNPUT} from './actionType'

 const defaultState = {
   "text":'hello demo reducer'
 }

 const DemoReducers = (state = defaultState,action)=>{
  console.log(action)
  switch (action.type) {
    case CHANGEiNPUT:
      return {...state,text:action.data}
    default:
      return state
  }
 }
/**
 * 更改 input 数据
 * @param {*} data
 */
export const changeAction = (data)=>{
  return {
    type:CHANGEiNPUT,
    data :data
  }
}

export default DemoReducers


